/**
 * @author 吴迪
 * @argument 报文内容显示的window
 * @version 1.0
 * @class ReportLogWin
 * @extends Ext.Window
 * @createTime 2012-6-26
 */
Ext.ns('Ext.ReportLog');
Ext.ReportLog.ReportLogWin = Ext.extend(Ext.Window, {
	constructor : function(_config) {
		if (_config == null) {
			_config = {};
		}
		;
		Ext.apply(this, _config);
		this.form = new Ext.FormPanel( {
			layout : 'fit',
			items : [ new Ext.form.TextArea( {
				name : 'content',
				readonly : true
			}) ]
		});
		Ext.ReportLog.ReportLogWin.superclass.constructor.call(this, {
			title : '报文内容',
			width : 800,
			height : 600,
			layout : 'fit',
			closeAction : 'hide',
			closable : true,
			modal : true,
			items : [ this.form ],
			frame : true,
			listeners : {
				hide : function() {
					this.form.getForm().reset();

				},
				scope : this
			},
			buttons : [
					{
						text : '关闭',
						handler : function() {
							this.hide();
						},
						scope : this
					} ]
		});
	},
	loadData : function(id) {
		this.form.getForm().load(
				{
					url : 'monitoringView/getLogInfo',
					method : 'post',
					params : {
						id : id
					},
					waitMsg : '正在加载数据...',
					success : function(form, action) {
						this.form.find('name', 'content')[0]
								.setValue(action.result.content);
					},
					failure : function() {
						Ext.MessageBox.alert('提示', '数据读取失败');
					},
					scope : this
				});
	}

});